﻿/*
 * HardwareCommunicationGateway.cs
 * Written by: Shawn Gilleland
 * 
 * The Hardware Communication Gateway that Central Processing
 * subsystems will interact with to activate Drawer LED's.  This
 * class utilizes the Bridge Pattern.
 */

using Supply_Fetch;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace IndicationLayer
{
    class HardwareCommunicationGateway
    {
        private HardwareCommunicationImpl hwImp;

        public HardwareCommunicationGateway()
        {
            hwImp = new ArduinoCommunication();
        }

        public void ActivateAllDrawers()
        {
            hwImp.ActivateAllDrawers();
        }

        public void ActivateDrawers(List<Drawer> drawers)
        {
            hwImp.ActivateDrawers(drawers);
        }

        public void ConnectToSerialPort()
        {
            hwImp.ConnectToSerialPort();
        }

        public bool SerialPortIsOpen()
        {
            return hwImp.SerialPortIsOpen();
        }

        public void DisposeSerialPort()
        {
            hwImp.DisposeSerialPort();
        }

        public void ActivateLED(int LED_ID)
        {
            hwImp.ActivateLED(LED_ID);
        }

        public void CloseCommunicationPort()
        {
            hwImp.CloseCommunicationPort();
        }

        public void DeactivateAllDrawers(){
            hwImp.DeactivateAllDrawers();
        }

        public void CommunicationWait(int t)
        {
            hwImp.CommunicationWait(t);
        }

        public void DeactivateLED(int LED_ID)
        {
            hwImp.DeactivateLED(LED_ID);
        }

        public void CloseSerialPort()
        {
            this.hwImp.CloseSerialPort();
        }
    }
}
